export const TOGGLE = "shop";

const initialState = {
    data: [{
            id: "1",
            specs: ["紫色", "套餐一", "64G"]
        },
        {
            id: "2",
            specs: ["紫色", "套餐一", "128G"]
        },
        {
            id: "3",
            specs: ["紫色", "套餐二", "128G"]
        },
        {
            id: "4",
            specs: ["黑色", "套餐三", "256G"]
        }
    ],
    commoditySpecs: [{
            title: "颜色",
            list: ["红色", "紫色", "白色", "黑色"]
        },
        {
            title: "套餐",
            list: ["套餐一", "套餐二", "套餐三", "套餐四"]
        },
        {
            title: "内存",
            list: ["64G", "128G", "256G"]
        }
    ]
};

export default (state = initialState, action) => {
    switch (action.type) {
        case TOGGLE: {
            return {
                ...state
            };
        }

        default: {
            return {
                ...state
            };
        }
    }
};

export const toggleSwitch = () => dispatch => {
    dispatch({
        type: TOGGLE
    });
};